class Solution {
public:
    string A[10]={"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
   void func(int depth, vector<string>& v, string conmbinstr, string digits)
    {
        if(depth==digits.size())
        {
            v.push_back(conmbinstr);
            return;
        }

        int num=digits[depth]-'0';
        string a=A[num];
        for(int i=0;i<a.size();++i)
            func(depth+1,v,conmbinstr+a[i],digits);
    }

    vector<string> letterCombinations(string digits) {
        vector<string> v;
        if(digits.size()==0)
            return v;
        func(0,v,"",digits);
            return v;
    }
};
